package com.ruoyi.depot.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 入库详细表
 * @TableName tb_procured_storage_detail
 */
@TableName(value ="tb_procured_storage_detail")
@Data
public class ProcuredStorageDetail implements Serializable {
    /**
     * 入库详细ID
     */
    @TableId(value = "detail_id")
    private String detailId;

    /**
     * 关联入库单ID
     */
    @TableField(value = "storage_id")
    private String storageId;

    /**
     * 质检详细ID
     */
    @TableField(value = "inspection_detail_id")
    private String inspectionDetailId;

    /**
     * 商品ID
     */
    @TableField(value = "product_id")
    private Long productId;

    /**
     * 商品名称
     */
    @TableField(value = "product_name")
    private String productName;

    /**
     * 批次号
     */
    @TableField(value = "batch_number")
    private String batchNumber;

    /**
     * 保质期/过期日期
     */
    @TableField(value = "expiration_date")
    private Date expirationDate;

    /**
     * 入库时间
     */
    @TableField(value = "inbound_time")
    private Date inboundTime;

    /**
     * 计划入库数量
     */
    @TableField(value = "planned_quantity")
    private Integer plannedQuantity;

    /**
     * 实际入库数量
     */
    @TableField(value = "actual_quantity")
    private Integer actualQuantity;

    /**
     * 良品数量
     */
    @TableField(value = "good_quantity")
    private Integer goodQuantity;

    /**
     * 次品数量
     */
    @TableField(value = "defective_quantity")
    private Integer defectiveQuantity;

    /**
     * 待检数量
     */
    @TableField(value = "waiting_quantity")
    private Integer waitingQuantity;

    /**
     * 存储仓位ID
     */
    @TableField(value = "location_id")
    private Integer locationId;

    /**
     * 入库类型 (如采购入库、退货入库等)
     */
    @TableField(value = "type")
    private Integer type;

    /**
     * 备注信息
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 添加时间
     */
    @TableField(value = "add_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date addTime;

    /**
     * 修改时间
     */
    @TableField(value = "update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 删除状态 (0: 存在, 1: 删除)
     */
    @TableField(value = "delete_status")
    @TableLogic
    private Integer deleteStatus;

    /**
     * gtin
     */
    @TableField(value = "gtin")
    private String gtin;

    /**
     * gtins
     */
    @TableField(exist = false)
    private List<String> gtins;

    /**
     * 产品sku
     */
    @TableField(exist = false)
    private String productSku;

    /**
     * 产品价格
     */
    @TableField(exist = false)
    private BigDecimal price;

    /**
     * 单品成本
     */
    @TableField(exist = false)
    private BigDecimal singleProductCost;

    /**
     * 产品图片路径
     */
    @TableField(exist = false)
    private List<String> productImages;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ProcuredStorageDetail other = (ProcuredStorageDetail) that;
        return (this.getDetailId() == null ? other.getDetailId() == null : this.getDetailId().equals(other.getDetailId()))
            && (this.getStorageId() == null ? other.getStorageId() == null : this.getStorageId().equals(other.getStorageId()))
            && (this.getInspectionDetailId() == null ? other.getInspectionDetailId() == null : this.getInspectionDetailId().equals(other.getInspectionDetailId()))
            && (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
            && (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName()))
            && (this.getBatchNumber() == null ? other.getBatchNumber() == null : this.getBatchNumber().equals(other.getBatchNumber()))
            && (this.getExpirationDate() == null ? other.getExpirationDate() == null : this.getExpirationDate().equals(other.getExpirationDate()))
            && (this.getPlannedQuantity() == null ? other.getPlannedQuantity() == null : this.getPlannedQuantity().equals(other.getPlannedQuantity()))
            && (this.getActualQuantity() == null ? other.getActualQuantity() == null : this.getActualQuantity().equals(other.getActualQuantity()))
            && (this.getGoodQuantity() == null ? other.getGoodQuantity() == null : this.getGoodQuantity().equals(other.getGoodQuantity()))
            && (this.getDefectiveQuantity() == null ? other.getDefectiveQuantity() == null : this.getDefectiveQuantity().equals(other.getDefectiveQuantity()))
            && (this.getWaitingQuantity() == null ? other.getWaitingQuantity() == null : this.getWaitingQuantity().equals(other.getWaitingQuantity()))
            && (this.getLocationId() == null ? other.getLocationId() == null : this.getLocationId().equals(other.getLocationId()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getDeleteStatus() == null ? other.getDeleteStatus() == null : this.getDeleteStatus().equals(other.getDeleteStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getDetailId() == null) ? 0 : getDetailId().hashCode());
        result = prime * result + ((getStorageId() == null) ? 0 : getStorageId().hashCode());
        result = prime * result + ((getInspectionDetailId() == null) ? 0 : getInspectionDetailId().hashCode());
        result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
        result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode());
        result = prime * result + ((getBatchNumber() == null) ? 0 : getBatchNumber().hashCode());
        result = prime * result + ((getExpirationDate() == null) ? 0 : getExpirationDate().hashCode());
        result = prime * result + ((getPlannedQuantity() == null) ? 0 : getPlannedQuantity().hashCode());
        result = prime * result + ((getActualQuantity() == null) ? 0 : getActualQuantity().hashCode());
        result = prime * result + ((getGoodQuantity() == null) ? 0 : getGoodQuantity().hashCode());
        result = prime * result + ((getDefectiveQuantity() == null) ? 0 : getDefectiveQuantity().hashCode());
        result = prime * result + ((getWaitingQuantity() == null) ? 0 : getWaitingQuantity().hashCode());
        result = prime * result + ((getLocationId() == null) ? 0 : getLocationId().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getDeleteStatus() == null) ? 0 : getDeleteStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", detailId=").append(detailId);
        sb.append(", storageId=").append(storageId);
        sb.append(", inspectionDetailId=").append(inspectionDetailId);
        sb.append(", productId=").append(productId);
        sb.append(", productName=").append(productName);
        sb.append(", batchNumber=").append(batchNumber);
        sb.append(", expirationDate=").append(expirationDate);
        sb.append(", plannedQuantity=").append(plannedQuantity);
        sb.append(", actualQuantity=").append(actualQuantity);
        sb.append(", goodQuantity=").append(goodQuantity);
        sb.append(", defectiveQuantity=").append(defectiveQuantity);
        sb.append(", waitingQuantity=").append(waitingQuantity);
        sb.append(", locationId=").append(locationId);
        sb.append(", type=").append(type);
        sb.append(", remark=").append(remark);
        sb.append(", addTime=").append(addTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", deleteStatus=").append(deleteStatus);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}